<?php
/**
 * Created by PhpStorm.
 * User: necis
 * Date: 2017/1/12
 * Time: 下午11:39
 */

include 'phpqrcode/phpqrcode.php';
include_once('Model.class.php');
$model = M('game_id');

$arr = $model->limit('317,367')->select();

$urlA = "http://campaign.mobiloil.com.cn/pvl/drmobil-tce-qa/?sessionid=";
function qr($url,$name){
    $value = $url;
    $qr_eclevel = 'H';//容错级别
    $picsize = 14;//生成图片大小
    $margin=1;
    QRcode::png($value, 'png/'.$name.'.png', $qr_eclevel, $picsize, $margin);//生成二维码图片
}

foreach($arr as $key => $value){
//    $id = $value['id'];
    $id=$key+1;
    $name = trim($id).'+'.trim($value['sessionid']);
    $url = $urlA.$value['sessionid'];
    qr($url,$name);
}

?>